(0) Obligation:

The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(1, n^2).


The TRS R consists of the following rules:

#less(@x, @y) → #cklt(#compare(@x, @y))
append(@l1, @l2) → append#1(@l1, @l2)
append#1(::(@x, @xs), @l2) → ::(@x, append(@xs, @l2))
append#1(nil, @l2) → @l2
flatten(@t) → flatten#1(@t)
flatten#1(leaf) → nil
flatten#1(node(@l, @t1, @t2)) → append(@l, append(flatten(@t1), flatten(@t2)))
flattensort(@t) → insertionsort(flatten(@t))
insert(@x, @l) → insert#1(@l, @x)
insert#1(::(@y, @ys), @x) → insert#2(#less(@y, @x), @x, @y, @ys)
insert#1(nil, @x) → ::(@x, nil)
insert#2(#false, @x, @y, @ys) → ::(@x, ::(@y, @ys))
insert#2(#true, @x, @y, @ys) → ::(@y, insert(@x, @ys))
insertionsort(@l) → insertionsort#1(@l)
insertionsort#1(::(@x, @xs)) → insert(@x, insertionsort(@xs))
insertionsort#1(nil) → nil

The (relative) TRS S consists of the following rules:

#cklt(#EQ) → #false
#cklt(#GT) → #false
#cklt(#LT) → #true
#compare(#0, #0) → #EQ
#compare(#0, #neg(@y)) → #GT
#compare(#0, #pos(@y)) → #LT
#compare(#0, #s(@y)) → #LT
#compare(#neg(@x), #0) → #LT
#compare(#neg(@x), #neg(@y)) → #compare(@y, @x)
#compare(#neg(@x), #pos(@y)) → #LT
#compare(#pos(@x), #0) → #GT
#compare(#pos(@x), #neg(@y)) → #GT
#compare(#pos(@x), #pos(@y)) → #compare(@x, @y)
#compare(#s(@x), #0) → #GT
#compare(#s(@x), #s(@y)) → #compare(@x, @y)

Rewrite Strategy: INNERMOST

(1) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID) transformation)

Transformed relative TRS to weighted TRS

(2) Obligation:

The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^2).


The TRS R consists of the following rules:

#less(@x, @y) → #cklt(#compare(@x, @y)) [1]
append(@l1, @l2) → append#1(@l1, @l2) [1]
append#1(::(@x, @xs), @l2) → ::(@x, append(@xs, @l2)) [1]
append#1(nil, @l2) → @l2 [1]
flatten(@t) → flatten#1(@t) [1]
flatten#1(leaf) → nil [1]
flatten#1(node(@l, @t1, @t2)) → append(@l, append(flatten(@t1), flatten(@t2))) [1]
flattensort(@t) → insertionsort(flatten(@t)) [1]
insert(@x, @l) → insert#1(@l, @x) [1]
insert#1(::(@y, @ys), @x) → insert#2(#less(@y, @x), @x, @y, @ys) [1]
insert#1(nil, @x) → ::(@x, nil) [1]
insert#2(#false, @x, @y, @ys) → ::(@x, ::(@y, @ys)) [1]
insert#2(#true, @x, @y, @ys) → ::(@y, insert(@x, @ys)) [1]
insertionsort(@l) → insertionsort#1(@l) [1]
insertionsort#1(::(@x, @xs)) → insert(@x, insertionsort(@xs)) [1]
insertionsort#1(nil) → nil [1]
#cklt(#EQ) → #false [0]
#cklt(#GT) → #false [0]
#cklt(#LT) → #true [0]
#compare(#0, #0) → #EQ [0]
#compare(#0, #neg(@y)) → #GT [0]
#compare(#0, #pos(@y)) → #LT [0]
#compare(#0, #s(@y)) → #LT [0]
#compare(#neg(@x), #0) → #LT [0]
#compare(#neg(@x), #neg(@y)) → #compare(@y, @x) [0]
#compare(#neg(@x), #pos(@y)) → #LT [0]
#compare(#pos(@x), #0) → #GT [0]
#compare(#pos(@x), #neg(@y)) → #GT [0]
#compare(#pos(@x), #pos(@y)) → #compare(@x, @y) [0]
#compare(#s(@x), #0) → #GT [0]
#compare(#s(@x), #s(@y)) → #compare(@x, @y) [0]

Rewrite Strategy: INNERMOST

(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(4) Obligation:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

#less(@x, @y) → #cklt(#compare(@x, @y)) [1]
append(@l1, @l2) → append#1(@l1, @l2) [1]
append#1(::(@x, @xs), @l2) → ::(@x, append(@xs, @l2)) [1]
append#1(nil, @l2) → @l2 [1]
flatten(@t) → flatten#1(@t) [1]
flatten#1(leaf) → nil [1]
flatten#1(node(@l, @t1, @t2)) → append(@l, append(flatten(@t1), flatten(@t2))) [1]
flattensort(@t) → insertionsort(flatten(@t)) [1]
insert(@x, @l) → insert#1(@l, @x) [1]
insert#1(::(@y, @ys), @x) → insert#2(#less(@y, @x), @x, @y, @ys) [1]
insert#1(nil, @x) → ::(@x, nil) [1]
insert#2(#false, @x, @y, @ys) → ::(@x, ::(@y, @ys)) [1]
insert#2(#true, @x, @y, @ys) → ::(@y, insert(@x, @ys)) [1]
insertionsort(@l) → insertionsort#1(@l) [1]
insertionsort#1(::(@x, @xs)) → insert(@x, insertionsort(@xs)) [1]
insertionsort#1(nil) → nil [1]
#cklt(#EQ) → #false [0]
#cklt(#GT) → #false [0]
#cklt(#LT) → #true [0]
#compare(#0, #0) → #EQ [0]
#compare(#0, #neg(@y)) → #GT [0]
#compare(#0, #pos(@y)) → #LT [0]
#compare(#0, #s(@y)) → #LT [0]
#compare(#neg(@x), #0) → #LT [0]
#compare(#neg(@x), #neg(@y)) → #compare(@y, @x) [0]
#compare(#neg(@x), #pos(@y)) → #LT [0]
#compare(#pos(@x), #0) → #GT [0]
#compare(#pos(@x), #neg(@y)) → #GT [0]
#compare(#pos(@x), #pos(@y)) → #compare(@x, @y) [0]
#compare(#s(@x), #0) → #GT [0]
#compare(#s(@x), #s(@y)) → #compare(@x, @y) [0]

The TRS has the following type information:
#less :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #false:#true
#cklt :: #EQ:#GT:#LT → #false:#true
#compare :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #EQ:#GT:#LT
append :: :::nil → :::nil → :::nil
append#1 :: :::nil → :::nil → :::nil
:: :: #0:#neg:#pos:#s → :::nil → :::nil
nil :: :::nil
flatten :: leaf:node → :::nil
flatten#1 :: leaf:node → :::nil
leaf :: leaf:node
node :: :::nil → leaf:node → leaf:node → leaf:node
flattensort :: leaf:node → :::nil
insertionsort :: :::nil → :::nil
insert :: #0:#neg:#pos:#s → :::nil → :::nil
insert#1 :: :::nil → #0:#neg:#pos:#s → :::nil
insert#2 :: #false:#true → #0:#neg:#pos:#s → #0:#neg:#pos:#s → :::nil → :::nil
#false :: #false:#true
#true :: #false:#true
insertionsort#1 :: :::nil → :::nil
#EQ :: #EQ:#GT:#LT
#GT :: #EQ:#GT:#LT
#LT :: #EQ:#GT:#LT
#0 :: #0:#neg:#pos:#s
#neg :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#pos :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#s :: #0:#neg:#pos:#s → #0:#neg:#pos:#s

Rewrite Strategy: INNERMOST

(5) CompletionProof (UPPER BOUND(ID) transformation)

The transformation into a RNTS is sound, since:

(a) The obligation is a constructor system where every type has a constant constructor,

(b) The following defined symbols do not have to be completely defined, as they can never occur inside other defined symbols:


flattensort

(c) The following functions are completely defined:

flatten
append
insertionsort
#less
flatten#1
append#1
insertionsort#1
insert
insert#1
insert#2
#cklt
#compare

Due to the following rules being added:

#cklt(v0) → null_#cklt [0]
#compare(v0, v1) → null_#compare [0]
insert#2(v0, v1, v2, v3) → nil [0]

And the following fresh constants:

null_#cklt, null_#compare

(6) Obligation:

Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

#less(@x, @y) → #cklt(#compare(@x, @y)) [1]
append(@l1, @l2) → append#1(@l1, @l2) [1]
append#1(::(@x, @xs), @l2) → ::(@x, append(@xs, @l2)) [1]
append#1(nil, @l2) → @l2 [1]
flatten(@t) → flatten#1(@t) [1]
flatten#1(leaf) → nil [1]
flatten#1(node(@l, @t1, @t2)) → append(@l, append(flatten(@t1), flatten(@t2))) [1]
flattensort(@t) → insertionsort(flatten(@t)) [1]
insert(@x, @l) → insert#1(@l, @x) [1]
insert#1(::(@y, @ys), @x) → insert#2(#less(@y, @x), @x, @y, @ys) [1]
insert#1(nil, @x) → ::(@x, nil) [1]
insert#2(#false, @x, @y, @ys) → ::(@x, ::(@y, @ys)) [1]
insert#2(#true, @x, @y, @ys) → ::(@y, insert(@x, @ys)) [1]
insertionsort(@l) → insertionsort#1(@l) [1]
insertionsort#1(::(@x, @xs)) → insert(@x, insertionsort(@xs)) [1]
insertionsort#1(nil) → nil [1]
#cklt(#EQ) → #false [0]
#cklt(#GT) → #false [0]
#cklt(#LT) → #true [0]
#compare(#0, #0) → #EQ [0]
#compare(#0, #neg(@y)) → #GT [0]
#compare(#0, #pos(@y)) → #LT [0]
#compare(#0, #s(@y)) → #LT [0]
#compare(#neg(@x), #0) → #LT [0]
#compare(#neg(@x), #neg(@y)) → #compare(@y, @x) [0]
#compare(#neg(@x), #pos(@y)) → #LT [0]
#compare(#pos(@x), #0) → #GT [0]
#compare(#pos(@x), #neg(@y)) → #GT [0]
#compare(#pos(@x), #pos(@y)) → #compare(@x, @y) [0]
#compare(#s(@x), #0) → #GT [0]
#compare(#s(@x), #s(@y)) → #compare(@x, @y) [0]
#cklt(v0) → null_#cklt [0]
#compare(v0, v1) → null_#compare [0]
insert#2(v0, v1, v2, v3) → nil [0]

The TRS has the following type information:
#less :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #false:#true:null_#cklt
#cklt :: #EQ:#GT:#LT:null_#compare → #false:#true:null_#cklt
#compare :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #EQ:#GT:#LT:null_#compare
append :: :::nil → :::nil → :::nil
append#1 :: :::nil → :::nil → :::nil
:: :: #0:#neg:#pos:#s → :::nil → :::nil
nil :: :::nil
flatten :: leaf:node → :::nil
flatten#1 :: leaf:node → :::nil
leaf :: leaf:node
node :: :::nil → leaf:node → leaf:node → leaf:node
flattensort :: leaf:node → :::nil
insertionsort :: :::nil → :::nil
insert :: #0:#neg:#pos:#s → :::nil → :::nil
insert#1 :: :::nil → #0:#neg:#pos:#s → :::nil
insert#2 :: #false:#true:null_#cklt → #0:#neg:#pos:#s → #0:#neg:#pos:#s → :::nil → :::nil
#false :: #false:#true:null_#cklt
#true :: #false:#true:null_#cklt
insertionsort#1 :: :::nil → :::nil
#EQ :: #EQ:#GT:#LT:null_#compare
#GT :: #EQ:#GT:#LT:null_#compare
#LT :: #EQ:#GT:#LT:null_#compare
#0 :: #0:#neg:#pos:#s
#neg :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#pos :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#s :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
null_#cklt :: #false:#true:null_#cklt
null_#compare :: #EQ:#GT:#LT:null_#compare

Rewrite Strategy: INNERMOST

(7) NarrowingProof (BOTH BOUNDS(ID, ID) transformation)

Narrowed the inner basic terms of all right-hand sides by a single narrowing step.

(8) Obligation:

Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

#less(#0, #0) → #cklt(#EQ) [1]
#less(#0, #neg(@y')) → #cklt(#GT) [1]
#less(#0, #pos(@y'')) → #cklt(#LT) [1]
#less(#0, #s(@y1)) → #cklt(#LT) [1]
#less(#neg(@x'), #0) → #cklt(#LT) [1]
#less(#neg(@x''), #neg(@y2)) → #cklt(#compare(@y2, @x'')) [1]
#less(#neg(@x1), #pos(@y3)) → #cklt(#LT) [1]
#less(#pos(@x2), #0) → #cklt(#GT) [1]
#less(#pos(@x3), #neg(@y4)) → #cklt(#GT) [1]
#less(#pos(@x4), #pos(@y5)) → #cklt(#compare(@x4, @y5)) [1]
#less(#s(@x5), #0) → #cklt(#GT) [1]
#less(#s(@x6), #s(@y6)) → #cklt(#compare(@x6, @y6)) [1]
#less(@x, @y) → #cklt(null_#compare) [1]
append(@l1, @l2) → append#1(@l1, @l2) [1]
append#1(::(@x, @xs), @l2) → ::(@x, append(@xs, @l2)) [1]
append#1(nil, @l2) → @l2 [1]
flatten(@t) → flatten#1(@t) [1]
flatten#1(leaf) → nil [1]
flatten#1(node(@l, @t1, @t2)) → append(@l, append(flatten#1(@t1), flatten#1(@t2))) [3]
flattensort(@t) → insertionsort(flatten#1(@t)) [2]
insert(@x, @l) → insert#1(@l, @x) [1]
insert#1(::(@y, @ys), @x) → insert#2(#cklt(#compare(@y, @x)), @x, @y, @ys) [2]
insert#1(nil, @x) → ::(@x, nil) [1]
insert#2(#false, @x, @y, @ys) → ::(@x, ::(@y, @ys)) [1]
insert#2(#true, @x, @y, @ys) → ::(@y, insert(@x, @ys)) [1]
insertionsort(@l) → insertionsort#1(@l) [1]
insertionsort#1(::(@x, @xs)) → insert(@x, insertionsort#1(@xs)) [2]
insertionsort#1(nil) → nil [1]
#cklt(#EQ) → #false [0]
#cklt(#GT) → #false [0]
#cklt(#LT) → #true [0]
#compare(#0, #0) → #EQ [0]
#compare(#0, #neg(@y)) → #GT [0]
#compare(#0, #pos(@y)) → #LT [0]
#compare(#0, #s(@y)) → #LT [0]
#compare(#neg(@x), #0) → #LT [0]
#compare(#neg(@x), #neg(@y)) → #compare(@y, @x) [0]
#compare(#neg(@x), #pos(@y)) → #LT [0]
#compare(#pos(@x), #0) → #GT [0]
#compare(#pos(@x), #neg(@y)) → #GT [0]
#compare(#pos(@x), #pos(@y)) → #compare(@x, @y) [0]
#compare(#s(@x), #0) → #GT [0]
#compare(#s(@x), #s(@y)) → #compare(@x, @y) [0]
#cklt(v0) → null_#cklt [0]
#compare(v0, v1) → null_#compare [0]
insert#2(v0, v1, v2, v3) → nil [0]

The TRS has the following type information:
#less :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #false:#true:null_#cklt
#cklt :: #EQ:#GT:#LT:null_#compare → #false:#true:null_#cklt
#compare :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #EQ:#GT:#LT:null_#compare
append :: :::nil → :::nil → :::nil
append#1 :: :::nil → :::nil → :::nil
:: :: #0:#neg:#pos:#s → :::nil → :::nil
nil :: :::nil
flatten :: leaf:node → :::nil
flatten#1 :: leaf:node → :::nil
leaf :: leaf:node
node :: :::nil → leaf:node → leaf:node → leaf:node
flattensort :: leaf:node → :::nil
insertionsort :: :::nil → :::nil
insert :: #0:#neg:#pos:#s → :::nil → :::nil
insert#1 :: :::nil → #0:#neg:#pos:#s → :::nil
insert#2 :: #false:#true:null_#cklt → #0:#neg:#pos:#s → #0:#neg:#pos:#s → :::nil → :::nil
#false :: #false:#true:null_#cklt
#true :: #false:#true:null_#cklt
insertionsort#1 :: :::nil → :::nil
#EQ :: #EQ:#GT:#LT:null_#compare
#GT :: #EQ:#GT:#LT:null_#compare
#LT :: #EQ:#GT:#LT:null_#compare
#0 :: #0:#neg:#pos:#s
#neg :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#pos :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#s :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
null_#cklt :: #false:#true:null_#cklt
null_#compare :: #EQ:#GT:#LT:null_#compare

Rewrite Strategy: INNERMOST

(9) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID) transformation)

Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction.
The constant constructors are abstracted as follows:

nil => 0
leaf => 0
#false => 1
#true => 2
#EQ => 1
#GT => 2
#LT => 3
#0 => 0
null_#cklt => 0
null_#compare => 0

(10) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: v0 >= 0, z = v0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' = 1 + @y, @y >= 0
#compare(z, z') -{ 0 }→ 3 :|: @x >= 0, z = 1 + @x, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: @x >= 0, z = 1 + @x, z' = 1 + @y, @y >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' = 1 + @y, @y >= 0
#compare(z, z') -{ 0 }→ 2 :|: @x >= 0, z = 1 + @x, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: @x >= 0, z = 1 + @x, z' = 1 + @y, @y >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1
#compare(z, z') -{ 0 }→ #compare(@x, @y) :|: @x >= 0, z = 1 + @x, z' = 1 + @y, @y >= 0
#compare(z, z') -{ 0 }→ #compare(@y, @x) :|: @x >= 0, z = 1 + @x, z' = 1 + @y, @y >= 0
#less(z, z') -{ 1 }→ #cklt(3) :|: z' = 1 + @y'', @y'' >= 0, z = 0
#less(z, z') -{ 1 }→ #cklt(3) :|: z' = 1 + @y1, @y1 >= 0, z = 0
#less(z, z') -{ 1 }→ #cklt(3) :|: z = 1 + @x', @x' >= 0, z' = 0
#less(z, z') -{ 1 }→ #cklt(3) :|: @y3 >= 0, @x1 >= 0, z' = 1 + @y3, z = 1 + @x1
#less(z, z') -{ 1 }→ #cklt(2) :|: @y' >= 0, z' = 1 + @y', z = 0
#less(z, z') -{ 1 }→ #cklt(2) :|: @x2 >= 0, z = 1 + @x2, z' = 0
#less(z, z') -{ 1 }→ #cklt(2) :|: @x3 >= 0, z' = 1 + @y4, z = 1 + @x3, @y4 >= 0
#less(z, z') -{ 1 }→ #cklt(2) :|: z = 1 + @x5, @x5 >= 0, z' = 0
#less(z, z') -{ 1 }→ #cklt(1) :|: z = 0, z' = 0
#less(z, z') -{ 1 }→ #cklt(0) :|: z = @x, @x >= 0, z' = @y, @y >= 0
#less(z, z') -{ 1 }→ #cklt(#compare(@x4, @y5)) :|: z' = 1 + @y5, @y5 >= 0, z = 1 + @x4, @x4 >= 0
#less(z, z') -{ 1 }→ #cklt(#compare(@x6, @y6)) :|: z = 1 + @x6, z' = 1 + @y6, @x6 >= 0, @y6 >= 0
#less(z, z') -{ 1 }→ #cklt(#compare(@y2, @x'')) :|: z = 1 + @x'', z' = 1 + @y2, @y2 >= 0, @x'' >= 0
append(z, z') -{ 1 }→ append#1(@l1, @l2) :|: @l1 >= 0, z' = @l2, @l2 >= 0, z = @l1
append#1(z, z') -{ 1 }→ @l2 :|: z' = @l2, @l2 >= 0, z = 0
append#1(z, z') -{ 1 }→ 1 + @x + append(@xs, @l2) :|: z' = @l2, @x >= 0, z = 1 + @x + @xs, @l2 >= 0, @xs >= 0
flatten(z) -{ 1 }→ flatten#1(@t) :|: z = @t, @t >= 0
flatten#1(z) -{ 3 }→ append(@l, append(flatten#1(@t1), flatten#1(@t2))) :|: @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 2 }→ insertionsort(flatten#1(@t)) :|: z = @t, @t >= 0
insert(z, z') -{ 1 }→ insert#1(@l, @x) :|: z = @x, @l >= 0, @x >= 0, z' = @l
insert#1(z, z') -{ 2 }→ insert#2(#cklt(#compare(@y, @x)), @x, @y, @ys) :|: z = 1 + @y + @ys, @x >= 0, @y >= 0, z' = @x, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + @x + 0 :|: @x >= 0, z = 0, z' = @x
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z1 = v3, v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0, v3 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + @x + (1 + @y + @ys) :|: @x >= 0, z = 1, z1 = @ys, @y >= 0, z' = @x, @ys >= 0, z'' = @y
insert#2(z, z', z'', z1) -{ 1 }→ 1 + @y + insert(@x, @ys) :|: z = 2, @x >= 0, z1 = @ys, @y >= 0, z' = @x, @ys >= 0, z'' = @y
insertionsort(z) -{ 1 }→ insertionsort#1(@l) :|: z = @l, @l >= 0
insertionsort#1(z) -{ 2 }→ insert(@x, insertionsort#1(@xs)) :|: @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

(11) InliningProof (UPPER BOUND(ID) transformation)

Inlined the following terminating rules on right-hand sides where appropriate:

#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 0 :|: v0 >= 0, z = v0

(12) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: v0 >= 0, z = v0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' = 1 + @y, @y >= 0
#compare(z, z') -{ 0 }→ 3 :|: @x >= 0, z = 1 + @x, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: @x >= 0, z = 1 + @x, z' = 1 + @y, @y >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' = 1 + @y, @y >= 0
#compare(z, z') -{ 0 }→ 2 :|: @x >= 0, z = 1 + @x, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: @x >= 0, z = 1 + @x, z' = 1 + @y, @y >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1
#compare(z, z') -{ 0 }→ #compare(@x, @y) :|: @x >= 0, z = 1 + @x, z' = 1 + @y, @y >= 0
#compare(z, z') -{ 0 }→ #compare(@y, @x) :|: @x >= 0, z = 1 + @x, z' = 1 + @y, @y >= 0
#less(z, z') -{ 1 }→ 2 :|: z' = 1 + @y'', @y'' >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' = 1 + @y1, @y1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z = 1 + @x', @x' >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: @y3 >= 0, @x1 >= 0, z' = 1 + @y3, z = 1 + @x1, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: @y' >= 0, z' = 1 + @y', z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: @x2 >= 0, z = 1 + @x2, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: @x3 >= 0, z' = 1 + @y4, z = 1 + @x3, @y4 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z = 1 + @x5, @x5 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: @y' >= 0, z' = 1 + @y', z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' = 1 + @y'', @y'' >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' = 1 + @y1, @y1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z = 1 + @x', @x' >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: @y3 >= 0, @x1 >= 0, z' = 1 + @y3, z = 1 + @x1, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: @x2 >= 0, z = 1 + @x2, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: @x3 >= 0, z' = 1 + @y4, z = 1 + @x3, @y4 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z = 1 + @x5, @x5 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z = @x, @x >= 0, z' = @y, @y >= 0, v0 >= 0, 0 = v0
#less(z, z') -{ 1 }→ #cklt(#compare(@x4, @y5)) :|: z' = 1 + @y5, @y5 >= 0, z = 1 + @x4, @x4 >= 0
#less(z, z') -{ 1 }→ #cklt(#compare(@x6, @y6)) :|: z = 1 + @x6, z' = 1 + @y6, @x6 >= 0, @y6 >= 0
#less(z, z') -{ 1 }→ #cklt(#compare(@y2, @x'')) :|: z = 1 + @x'', z' = 1 + @y2, @y2 >= 0, @x'' >= 0
append(z, z') -{ 1 }→ append#1(@l1, @l2) :|: @l1 >= 0, z' = @l2, @l2 >= 0, z = @l1
append#1(z, z') -{ 1 }→ @l2 :|: z' = @l2, @l2 >= 0, z = 0
append#1(z, z') -{ 1 }→ 1 + @x + append(@xs, @l2) :|: z' = @l2, @x >= 0, z = 1 + @x + @xs, @l2 >= 0, @xs >= 0
flatten(z) -{ 1 }→ flatten#1(@t) :|: z = @t, @t >= 0
flatten#1(z) -{ 3 }→ append(@l, append(flatten#1(@t1), flatten#1(@t2))) :|: @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 2 }→ insertionsort(flatten#1(@t)) :|: z = @t, @t >= 0
insert(z, z') -{ 1 }→ insert#1(@l, @x) :|: z = @x, @l >= 0, @x >= 0, z' = @l
insert#1(z, z') -{ 2 }→ insert#2(#cklt(#compare(@y, @x)), @x, @y, @ys) :|: z = 1 + @y + @ys, @x >= 0, @y >= 0, z' = @x, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + @x + 0 :|: @x >= 0, z = 0, z' = @x
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z1 = v3, v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0, v3 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + @x + (1 + @y + @ys) :|: @x >= 0, z = 1, z1 = @ys, @y >= 0, z' = @x, @ys >= 0, z'' = @y
insert#2(z, z', z'', z1) -{ 1 }→ 1 + @y + insert(@x, @ys) :|: z = 2, @x >= 0, z1 = @ys, @y >= 0, z' = @x, @ys >= 0, z'' = @y
insertionsort(z) -{ 1 }→ insertionsort#1(@l) :|: z = @l, @l >= 0
insertionsort#1(z) -{ 2 }→ insert(@x, insertionsort#1(@xs)) :|: @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

(13) SimplificationProof (BOTH BOUNDS(ID, ID) transformation)

Simplified the RNTS by moving equalities from the constraints into the right-hand sides.

(14) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#compare(z, z') -{ 0 }→ #compare(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ #compare(z' - 1, z - 1) :|: z - 1 >= 0, z' - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
#less(z, z') -{ 1 }→ #cklt(#compare(z - 1, z' - 1)) :|: z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ #cklt(#compare(z' - 1, z - 1)) :|: z' - 1 >= 0, z - 1 >= 0
append(z, z') -{ 1 }→ append#1(z, z') :|: z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 1 }→ 1 + @x + append(@xs, z') :|: @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 1 }→ flatten#1(z) :|: z >= 0
flatten#1(z) -{ 3 }→ append(@l, append(flatten#1(@t1), flatten#1(@t2))) :|: @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 2 }→ insertionsort(flatten#1(z)) :|: z >= 0
insert(z, z') -{ 1 }→ insert#1(z', z) :|: z' >= 0, z >= 0
insert#1(z, z') -{ 2 }→ insert#2(#cklt(#compare(@y, z')), z', @y, @ys) :|: z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z'' + insert(z', z1) :|: z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 1 }→ insertionsort#1(z) :|: z >= 0
insertionsort#1(z) -{ 2 }→ insert(@x, insertionsort#1(@xs)) :|: @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

(15) CpxRntsAnalysisOrderProof (BOTH BOUNDS(ID, ID) transformation)

Found the following analysis order by SCC decomposition:

{ #compare }
{ append#1, append }
{ #cklt }
{ #less }
{ insert#2, insert, insert#1 }
{ flatten#1 }
{ insertionsort#1 }
{ flatten }
{ insertionsort }
{ flattensort }

(16) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#compare(z, z') -{ 0 }→ #compare(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ #compare(z' - 1, z - 1) :|: z - 1 >= 0, z' - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
#less(z, z') -{ 1 }→ #cklt(#compare(z - 1, z' - 1)) :|: z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ #cklt(#compare(z' - 1, z - 1)) :|: z' - 1 >= 0, z - 1 >= 0
append(z, z') -{ 1 }→ append#1(z, z') :|: z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 1 }→ 1 + @x + append(@xs, z') :|: @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 1 }→ flatten#1(z) :|: z >= 0
flatten#1(z) -{ 3 }→ append(@l, append(flatten#1(@t1), flatten#1(@t2))) :|: @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 2 }→ insertionsort(flatten#1(z)) :|: z >= 0
insert(z, z') -{ 1 }→ insert#1(z', z) :|: z' >= 0, z >= 0
insert#1(z, z') -{ 2 }→ insert#2(#cklt(#compare(@y, z')), z', @y, @ys) :|: z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z'' + insert(z', z1) :|: z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 1 }→ insertionsort#1(z) :|: z >= 0
insertionsort#1(z) -{ 2 }→ insert(@x, insertionsort#1(@xs)) :|: @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {#compare}, {append#1,append}, {#cklt}, {#less}, {insert#2,insert,insert#1}, {flatten#1}, {insertionsort#1}, {flatten}, {insertionsort}, {flattensort}

(17) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: #compare
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 3

(18) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#compare(z, z') -{ 0 }→ #compare(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ #compare(z' - 1, z - 1) :|: z - 1 >= 0, z' - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
#less(z, z') -{ 1 }→ #cklt(#compare(z - 1, z' - 1)) :|: z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ #cklt(#compare(z' - 1, z - 1)) :|: z' - 1 >= 0, z - 1 >= 0
append(z, z') -{ 1 }→ append#1(z, z') :|: z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 1 }→ 1 + @x + append(@xs, z') :|: @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 1 }→ flatten#1(z) :|: z >= 0
flatten#1(z) -{ 3 }→ append(@l, append(flatten#1(@t1), flatten#1(@t2))) :|: @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 2 }→ insertionsort(flatten#1(z)) :|: z >= 0
insert(z, z') -{ 1 }→ insert#1(z', z) :|: z' >= 0, z >= 0
insert#1(z, z') -{ 2 }→ insert#2(#cklt(#compare(@y, z')), z', @y, @ys) :|: z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z'' + insert(z', z1) :|: z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 1 }→ insertionsort#1(z) :|: z >= 0
insertionsort#1(z) -{ 2 }→ insert(@x, insertionsort#1(@xs)) :|: @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {#compare}, {append#1,append}, {#cklt}, {#less}, {insert#2,insert,insert#1}, {flatten#1}, {insertionsort#1}, {flatten}, {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: ?, size: O(1) [3]

(19) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: #compare
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 0

(20) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#compare(z, z') -{ 0 }→ #compare(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ #compare(z' - 1, z - 1) :|: z - 1 >= 0, z' - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
#less(z, z') -{ 1 }→ #cklt(#compare(z - 1, z' - 1)) :|: z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ #cklt(#compare(z' - 1, z - 1)) :|: z' - 1 >= 0, z - 1 >= 0
append(z, z') -{ 1 }→ append#1(z, z') :|: z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 1 }→ 1 + @x + append(@xs, z') :|: @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 1 }→ flatten#1(z) :|: z >= 0
flatten#1(z) -{ 3 }→ append(@l, append(flatten#1(@t1), flatten#1(@t2))) :|: @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 2 }→ insertionsort(flatten#1(z)) :|: z >= 0
insert(z, z') -{ 1 }→ insert#1(z', z) :|: z' >= 0, z >= 0
insert#1(z, z') -{ 2 }→ insert#2(#cklt(#compare(@y, z')), z', @y, @ys) :|: z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z'' + insert(z', z1) :|: z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 1 }→ insertionsort#1(z) :|: z >= 0
insertionsort#1(z) -{ 2 }→ insert(@x, insertionsort#1(@xs)) :|: @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {append#1,append}, {#cklt}, {#less}, {insert#2,insert,insert#1}, {flatten#1}, {insertionsort#1}, {flatten}, {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]

(21) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(22) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
#less(z, z') -{ 1 }→ #cklt(s'') :|: s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ #cklt(s1) :|: s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
append(z, z') -{ 1 }→ append#1(z, z') :|: z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 1 }→ 1 + @x + append(@xs, z') :|: @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 1 }→ flatten#1(z) :|: z >= 0
flatten#1(z) -{ 3 }→ append(@l, append(flatten#1(@t1), flatten#1(@t2))) :|: @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 2 }→ insertionsort(flatten#1(z)) :|: z >= 0
insert(z, z') -{ 1 }→ insert#1(z', z) :|: z' >= 0, z >= 0
insert#1(z, z') -{ 2 }→ insert#2(#cklt(s2), z', @y, @ys) :|: s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z'' + insert(z', z1) :|: z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 1 }→ insertionsort#1(z) :|: z >= 0
insertionsort#1(z) -{ 2 }→ insert(@x, insertionsort#1(@xs)) :|: @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {append#1,append}, {#cklt}, {#less}, {insert#2,insert,insert#1}, {flatten#1}, {insertionsort#1}, {flatten}, {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]

(23) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: append#1
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z + z'

Computed SIZE bound using CoFloCo for: append
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z + z'

(24) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
#less(z, z') -{ 1 }→ #cklt(s'') :|: s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ #cklt(s1) :|: s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
append(z, z') -{ 1 }→ append#1(z, z') :|: z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 1 }→ 1 + @x + append(@xs, z') :|: @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 1 }→ flatten#1(z) :|: z >= 0
flatten#1(z) -{ 3 }→ append(@l, append(flatten#1(@t1), flatten#1(@t2))) :|: @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 2 }→ insertionsort(flatten#1(z)) :|: z >= 0
insert(z, z') -{ 1 }→ insert#1(z', z) :|: z' >= 0, z >= 0
insert#1(z, z') -{ 2 }→ insert#2(#cklt(s2), z', @y, @ys) :|: s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z'' + insert(z', z1) :|: z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 1 }→ insertionsort#1(z) :|: z >= 0
insertionsort#1(z) -{ 2 }→ insert(@x, insertionsort#1(@xs)) :|: @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {append#1,append}, {#cklt}, {#less}, {insert#2,insert,insert#1}, {flatten#1}, {insertionsort#1}, {flatten}, {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: ?, size: O(n1) [z + z']
append: runtime: ?, size: O(n1) [z + z']

(25) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using PUBS for: append#1
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + 2·z

Computed RUNTIME bound using CoFloCo for: append
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 2 + 2·z

(26) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
#less(z, z') -{ 1 }→ #cklt(s'') :|: s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ #cklt(s1) :|: s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
append(z, z') -{ 1 }→ append#1(z, z') :|: z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 1 }→ 1 + @x + append(@xs, z') :|: @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 1 }→ flatten#1(z) :|: z >= 0
flatten#1(z) -{ 3 }→ append(@l, append(flatten#1(@t1), flatten#1(@t2))) :|: @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 2 }→ insertionsort(flatten#1(z)) :|: z >= 0
insert(z, z') -{ 1 }→ insert#1(z', z) :|: z' >= 0, z >= 0
insert#1(z, z') -{ 2 }→ insert#2(#cklt(s2), z', @y, @ys) :|: s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z'' + insert(z', z1) :|: z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 1 }→ insertionsort#1(z) :|: z >= 0
insertionsort#1(z) -{ 2 }→ insert(@x, insertionsort#1(@xs)) :|: @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {#cklt}, {#less}, {insert#2,insert,insert#1}, {flatten#1}, {insertionsort#1}, {flatten}, {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']

(27) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(28) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
#less(z, z') -{ 1 }→ #cklt(s'') :|: s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ #cklt(s1) :|: s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
append(z, z') -{ 2 + 2·z }→ s3 :|: s3 >= 0, s3 <= 1 * z + 1 * z', z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 3 + 2·@xs }→ 1 + @x + s4 :|: s4 >= 0, s4 <= 1 * @xs + 1 * z', @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 1 }→ flatten#1(z) :|: z >= 0
flatten#1(z) -{ 3 }→ append(@l, append(flatten#1(@t1), flatten#1(@t2))) :|: @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 2 }→ insertionsort(flatten#1(z)) :|: z >= 0
insert(z, z') -{ 1 }→ insert#1(z', z) :|: z' >= 0, z >= 0
insert#1(z, z') -{ 2 }→ insert#2(#cklt(s2), z', @y, @ys) :|: s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z'' + insert(z', z1) :|: z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 1 }→ insertionsort#1(z) :|: z >= 0
insertionsort#1(z) -{ 2 }→ insert(@x, insertionsort#1(@xs)) :|: @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {#cklt}, {#less}, {insert#2,insert,insert#1}, {flatten#1}, {insertionsort#1}, {flatten}, {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']

(29) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: #cklt
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 2

(30) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
#less(z, z') -{ 1 }→ #cklt(s'') :|: s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ #cklt(s1) :|: s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
append(z, z') -{ 2 + 2·z }→ s3 :|: s3 >= 0, s3 <= 1 * z + 1 * z', z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 3 + 2·@xs }→ 1 + @x + s4 :|: s4 >= 0, s4 <= 1 * @xs + 1 * z', @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 1 }→ flatten#1(z) :|: z >= 0
flatten#1(z) -{ 3 }→ append(@l, append(flatten#1(@t1), flatten#1(@t2))) :|: @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 2 }→ insertionsort(flatten#1(z)) :|: z >= 0
insert(z, z') -{ 1 }→ insert#1(z', z) :|: z' >= 0, z >= 0
insert#1(z, z') -{ 2 }→ insert#2(#cklt(s2), z', @y, @ys) :|: s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z'' + insert(z', z1) :|: z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 1 }→ insertionsort#1(z) :|: z >= 0
insertionsort#1(z) -{ 2 }→ insert(@x, insertionsort#1(@xs)) :|: @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {#cklt}, {#less}, {insert#2,insert,insert#1}, {flatten#1}, {insertionsort#1}, {flatten}, {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
#cklt: runtime: ?, size: O(1) [2]

(31) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: #cklt
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 0

(32) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
#less(z, z') -{ 1 }→ #cklt(s'') :|: s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ #cklt(s1) :|: s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
append(z, z') -{ 2 + 2·z }→ s3 :|: s3 >= 0, s3 <= 1 * z + 1 * z', z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 3 + 2·@xs }→ 1 + @x + s4 :|: s4 >= 0, s4 <= 1 * @xs + 1 * z', @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 1 }→ flatten#1(z) :|: z >= 0
flatten#1(z) -{ 3 }→ append(@l, append(flatten#1(@t1), flatten#1(@t2))) :|: @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 2 }→ insertionsort(flatten#1(z)) :|: z >= 0
insert(z, z') -{ 1 }→ insert#1(z', z) :|: z' >= 0, z >= 0
insert#1(z, z') -{ 2 }→ insert#2(#cklt(s2), z', @y, @ys) :|: s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z'' + insert(z', z1) :|: z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 1 }→ insertionsort#1(z) :|: z >= 0
insertionsort#1(z) -{ 2 }→ insert(@x, insertionsort#1(@xs)) :|: @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {#less}, {insert#2,insert,insert#1}, {flatten#1}, {insertionsort#1}, {flatten}, {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
#cklt: runtime: O(1) [0], size: O(1) [2]

(33) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(34) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ s5 :|: s5 >= 0, s5 <= 2, s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ s6 :|: s6 >= 0, s6 <= 2, s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
append(z, z') -{ 2 + 2·z }→ s3 :|: s3 >= 0, s3 <= 1 * z + 1 * z', z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 3 + 2·@xs }→ 1 + @x + s4 :|: s4 >= 0, s4 <= 1 * @xs + 1 * z', @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 1 }→ flatten#1(z) :|: z >= 0
flatten#1(z) -{ 3 }→ append(@l, append(flatten#1(@t1), flatten#1(@t2))) :|: @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 2 }→ insertionsort(flatten#1(z)) :|: z >= 0
insert(z, z') -{ 1 }→ insert#1(z', z) :|: z' >= 0, z >= 0
insert#1(z, z') -{ 2 }→ insert#2(s7, z', @y, @ys) :|: s7 >= 0, s7 <= 2, s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z'' + insert(z', z1) :|: z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 1 }→ insertionsort#1(z) :|: z >= 0
insertionsort#1(z) -{ 2 }→ insert(@x, insertionsort#1(@xs)) :|: @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {#less}, {insert#2,insert,insert#1}, {flatten#1}, {insertionsort#1}, {flatten}, {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
#cklt: runtime: O(1) [0], size: O(1) [2]

(35) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: #less
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 2

(36) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ s5 :|: s5 >= 0, s5 <= 2, s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ s6 :|: s6 >= 0, s6 <= 2, s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
append(z, z') -{ 2 + 2·z }→ s3 :|: s3 >= 0, s3 <= 1 * z + 1 * z', z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 3 + 2·@xs }→ 1 + @x + s4 :|: s4 >= 0, s4 <= 1 * @xs + 1 * z', @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 1 }→ flatten#1(z) :|: z >= 0
flatten#1(z) -{ 3 }→ append(@l, append(flatten#1(@t1), flatten#1(@t2))) :|: @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 2 }→ insertionsort(flatten#1(z)) :|: z >= 0
insert(z, z') -{ 1 }→ insert#1(z', z) :|: z' >= 0, z >= 0
insert#1(z, z') -{ 2 }→ insert#2(s7, z', @y, @ys) :|: s7 >= 0, s7 <= 2, s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z'' + insert(z', z1) :|: z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 1 }→ insertionsort#1(z) :|: z >= 0
insertionsort#1(z) -{ 2 }→ insert(@x, insertionsort#1(@xs)) :|: @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {#less}, {insert#2,insert,insert#1}, {flatten#1}, {insertionsort#1}, {flatten}, {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
#cklt: runtime: O(1) [0], size: O(1) [2]
#less: runtime: ?, size: O(1) [2]

(37) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: #less
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(38) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ s5 :|: s5 >= 0, s5 <= 2, s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ s6 :|: s6 >= 0, s6 <= 2, s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
append(z, z') -{ 2 + 2·z }→ s3 :|: s3 >= 0, s3 <= 1 * z + 1 * z', z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 3 + 2·@xs }→ 1 + @x + s4 :|: s4 >= 0, s4 <= 1 * @xs + 1 * z', @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 1 }→ flatten#1(z) :|: z >= 0
flatten#1(z) -{ 3 }→ append(@l, append(flatten#1(@t1), flatten#1(@t2))) :|: @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 2 }→ insertionsort(flatten#1(z)) :|: z >= 0
insert(z, z') -{ 1 }→ insert#1(z', z) :|: z' >= 0, z >= 0
insert#1(z, z') -{ 2 }→ insert#2(s7, z', @y, @ys) :|: s7 >= 0, s7 <= 2, s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z'' + insert(z', z1) :|: z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 1 }→ insertionsort#1(z) :|: z >= 0
insertionsort#1(z) -{ 2 }→ insert(@x, insertionsort#1(@xs)) :|: @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {insert#2,insert,insert#1}, {flatten#1}, {insertionsort#1}, {flatten}, {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
#cklt: runtime: O(1) [0], size: O(1) [2]
#less: runtime: O(1) [1], size: O(1) [2]

(39) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(40) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ s5 :|: s5 >= 0, s5 <= 2, s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ s6 :|: s6 >= 0, s6 <= 2, s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
append(z, z') -{ 2 + 2·z }→ s3 :|: s3 >= 0, s3 <= 1 * z + 1 * z', z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 3 + 2·@xs }→ 1 + @x + s4 :|: s4 >= 0, s4 <= 1 * @xs + 1 * z', @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 1 }→ flatten#1(z) :|: z >= 0
flatten#1(z) -{ 3 }→ append(@l, append(flatten#1(@t1), flatten#1(@t2))) :|: @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 2 }→ insertionsort(flatten#1(z)) :|: z >= 0
insert(z, z') -{ 1 }→ insert#1(z', z) :|: z' >= 0, z >= 0
insert#1(z, z') -{ 2 }→ insert#2(s7, z', @y, @ys) :|: s7 >= 0, s7 <= 2, s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z'' + insert(z', z1) :|: z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 1 }→ insertionsort#1(z) :|: z >= 0
insertionsort#1(z) -{ 2 }→ insert(@x, insertionsort#1(@xs)) :|: @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {insert#2,insert,insert#1}, {flatten#1}, {insertionsort#1}, {flatten}, {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
#cklt: runtime: O(1) [0], size: O(1) [2]
#less: runtime: O(1) [1], size: O(1) [2]

(41) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: insert#2
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 2 + z' + z'' + z1

Computed SIZE bound using CoFloCo for: insert
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + z + z'

Computed SIZE bound using CoFloCo for: insert#1
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + z + z'

(42) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ s5 :|: s5 >= 0, s5 <= 2, s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ s6 :|: s6 >= 0, s6 <= 2, s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
append(z, z') -{ 2 + 2·z }→ s3 :|: s3 >= 0, s3 <= 1 * z + 1 * z', z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 3 + 2·@xs }→ 1 + @x + s4 :|: s4 >= 0, s4 <= 1 * @xs + 1 * z', @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 1 }→ flatten#1(z) :|: z >= 0
flatten#1(z) -{ 3 }→ append(@l, append(flatten#1(@t1), flatten#1(@t2))) :|: @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 2 }→ insertionsort(flatten#1(z)) :|: z >= 0
insert(z, z') -{ 1 }→ insert#1(z', z) :|: z' >= 0, z >= 0
insert#1(z, z') -{ 2 }→ insert#2(s7, z', @y, @ys) :|: s7 >= 0, s7 <= 2, s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z'' + insert(z', z1) :|: z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 1 }→ insertionsort#1(z) :|: z >= 0
insertionsort#1(z) -{ 2 }→ insert(@x, insertionsort#1(@xs)) :|: @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {insert#2,insert,insert#1}, {flatten#1}, {insertionsort#1}, {flatten}, {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
#cklt: runtime: O(1) [0], size: O(1) [2]
#less: runtime: O(1) [1], size: O(1) [2]
insert#2: runtime: ?, size: O(n1) [2 + z' + z'' + z1]
insert: runtime: ?, size: O(n1) [1 + z + z']
insert#1: runtime: ?, size: O(n1) [1 + z + z']

(43) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: insert#2
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 3 + 4·z1

Computed RUNTIME bound using CoFloCo for: insert
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 2 + 4·z'

Computed RUNTIME bound using CoFloCo for: insert#1
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + 4·z

(44) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ s5 :|: s5 >= 0, s5 <= 2, s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ s6 :|: s6 >= 0, s6 <= 2, s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
append(z, z') -{ 2 + 2·z }→ s3 :|: s3 >= 0, s3 <= 1 * z + 1 * z', z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 3 + 2·@xs }→ 1 + @x + s4 :|: s4 >= 0, s4 <= 1 * @xs + 1 * z', @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 1 }→ flatten#1(z) :|: z >= 0
flatten#1(z) -{ 3 }→ append(@l, append(flatten#1(@t1), flatten#1(@t2))) :|: @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 2 }→ insertionsort(flatten#1(z)) :|: z >= 0
insert(z, z') -{ 1 }→ insert#1(z', z) :|: z' >= 0, z >= 0
insert#1(z, z') -{ 2 }→ insert#2(s7, z', @y, @ys) :|: s7 >= 0, s7 <= 2, s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z'' + insert(z', z1) :|: z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 1 }→ insertionsort#1(z) :|: z >= 0
insertionsort#1(z) -{ 2 }→ insert(@x, insertionsort#1(@xs)) :|: @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {flatten#1}, {insertionsort#1}, {flatten}, {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
#cklt: runtime: O(1) [0], size: O(1) [2]
#less: runtime: O(1) [1], size: O(1) [2]
insert#2: runtime: O(n1) [3 + 4·z1], size: O(n1) [2 + z' + z'' + z1]
insert: runtime: O(n1) [2 + 4·z'], size: O(n1) [1 + z + z']
insert#1: runtime: O(n1) [1 + 4·z], size: O(n1) [1 + z + z']

(45) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(46) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ s5 :|: s5 >= 0, s5 <= 2, s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ s6 :|: s6 >= 0, s6 <= 2, s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
append(z, z') -{ 2 + 2·z }→ s3 :|: s3 >= 0, s3 <= 1 * z + 1 * z', z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 3 + 2·@xs }→ 1 + @x + s4 :|: s4 >= 0, s4 <= 1 * @xs + 1 * z', @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 1 }→ flatten#1(z) :|: z >= 0
flatten#1(z) -{ 3 }→ append(@l, append(flatten#1(@t1), flatten#1(@t2))) :|: @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 2 }→ insertionsort(flatten#1(z)) :|: z >= 0
insert(z, z') -{ 2 + 4·z' }→ s8 :|: s8 >= 0, s8 <= 1 * z' + 1 * z + 1, z' >= 0, z >= 0
insert#1(z, z') -{ 5 + 4·@ys }→ s10 :|: s10 >= 0, s10 <= 1 * z' + 1 * @y + 1 * @ys + 2, s7 >= 0, s7 <= 2, s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 3 + 4·z1 }→ 1 + z'' + s9 :|: s9 >= 0, s9 <= 1 * z' + 1 * z1 + 1, z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 1 }→ insertionsort#1(z) :|: z >= 0
insertionsort#1(z) -{ 2 }→ insert(@x, insertionsort#1(@xs)) :|: @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {flatten#1}, {insertionsort#1}, {flatten}, {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
#cklt: runtime: O(1) [0], size: O(1) [2]
#less: runtime: O(1) [1], size: O(1) [2]
insert#2: runtime: O(n1) [3 + 4·z1], size: O(n1) [2 + z' + z'' + z1]
insert: runtime: O(n1) [2 + 4·z'], size: O(n1) [1 + z + z']
insert#1: runtime: O(n1) [1 + 4·z], size: O(n1) [1 + z + z']

(47) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: flatten#1
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + z

(48) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ s5 :|: s5 >= 0, s5 <= 2, s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ s6 :|: s6 >= 0, s6 <= 2, s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
append(z, z') -{ 2 + 2·z }→ s3 :|: s3 >= 0, s3 <= 1 * z + 1 * z', z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 3 + 2·@xs }→ 1 + @x + s4 :|: s4 >= 0, s4 <= 1 * @xs + 1 * z', @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 1 }→ flatten#1(z) :|: z >= 0
flatten#1(z) -{ 3 }→ append(@l, append(flatten#1(@t1), flatten#1(@t2))) :|: @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 2 }→ insertionsort(flatten#1(z)) :|: z >= 0
insert(z, z') -{ 2 + 4·z' }→ s8 :|: s8 >= 0, s8 <= 1 * z' + 1 * z + 1, z' >= 0, z >= 0
insert#1(z, z') -{ 5 + 4·@ys }→ s10 :|: s10 >= 0, s10 <= 1 * z' + 1 * @y + 1 * @ys + 2, s7 >= 0, s7 <= 2, s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 3 + 4·z1 }→ 1 + z'' + s9 :|: s9 >= 0, s9 <= 1 * z' + 1 * z1 + 1, z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 1 }→ insertionsort#1(z) :|: z >= 0
insertionsort#1(z) -{ 2 }→ insert(@x, insertionsort#1(@xs)) :|: @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {flatten#1}, {insertionsort#1}, {flatten}, {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
#cklt: runtime: O(1) [0], size: O(1) [2]
#less: runtime: O(1) [1], size: O(1) [2]
insert#2: runtime: O(n1) [3 + 4·z1], size: O(n1) [2 + z' + z'' + z1]
insert: runtime: O(n1) [2 + 4·z'], size: O(n1) [1 + z + z']
insert#1: runtime: O(n1) [1 + 4·z], size: O(n1) [1 + z + z']
flatten#1: runtime: ?, size: O(n1) [1 + z]

(49) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: flatten#1
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 1 + 8·z + 2·z2

(50) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ s5 :|: s5 >= 0, s5 <= 2, s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ s6 :|: s6 >= 0, s6 <= 2, s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
append(z, z') -{ 2 + 2·z }→ s3 :|: s3 >= 0, s3 <= 1 * z + 1 * z', z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 3 + 2·@xs }→ 1 + @x + s4 :|: s4 >= 0, s4 <= 1 * @xs + 1 * z', @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 1 }→ flatten#1(z) :|: z >= 0
flatten#1(z) -{ 3 }→ append(@l, append(flatten#1(@t1), flatten#1(@t2))) :|: @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 2 }→ insertionsort(flatten#1(z)) :|: z >= 0
insert(z, z') -{ 2 + 4·z' }→ s8 :|: s8 >= 0, s8 <= 1 * z' + 1 * z + 1, z' >= 0, z >= 0
insert#1(z, z') -{ 5 + 4·@ys }→ s10 :|: s10 >= 0, s10 <= 1 * z' + 1 * @y + 1 * @ys + 2, s7 >= 0, s7 <= 2, s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 3 + 4·z1 }→ 1 + z'' + s9 :|: s9 >= 0, s9 <= 1 * z' + 1 * z1 + 1, z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 1 }→ insertionsort#1(z) :|: z >= 0
insertionsort#1(z) -{ 2 }→ insert(@x, insertionsort#1(@xs)) :|: @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {insertionsort#1}, {flatten}, {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
#cklt: runtime: O(1) [0], size: O(1) [2]
#less: runtime: O(1) [1], size: O(1) [2]
insert#2: runtime: O(n1) [3 + 4·z1], size: O(n1) [2 + z' + z'' + z1]
insert: runtime: O(n1) [2 + 4·z'], size: O(n1) [1 + z + z']
insert#1: runtime: O(n1) [1 + 4·z], size: O(n1) [1 + z + z']
flatten#1: runtime: O(n2) [1 + 8·z + 2·z2], size: O(n1) [1 + z]

(51) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(52) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ s5 :|: s5 >= 0, s5 <= 2, s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ s6 :|: s6 >= 0, s6 <= 2, s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
append(z, z') -{ 2 + 2·z }→ s3 :|: s3 >= 0, s3 <= 1 * z + 1 * z', z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 3 + 2·@xs }→ 1 + @x + s4 :|: s4 >= 0, s4 <= 1 * @xs + 1 * z', @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 2 + 8·z + 2·z2 }→ s11 :|: s11 >= 0, s11 <= 1 * z + 1, z >= 0
flatten#1(z) -{ 9 + 2·@l + 8·@t1 + 2·@t12 + 8·@t2 + 2·@t22 + 2·s12 }→ s15 :|: s12 >= 0, s12 <= 1 * @t1 + 1, s13 >= 0, s13 <= 1 * @t2 + 1, s14 >= 0, s14 <= 1 * s12 + 1 * s13, s15 >= 0, s15 <= 1 * @l + 1 * s14, @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 3 + 8·z + 2·z2 }→ insertionsort(s16) :|: s16 >= 0, s16 <= 1 * z + 1, z >= 0
insert(z, z') -{ 2 + 4·z' }→ s8 :|: s8 >= 0, s8 <= 1 * z' + 1 * z + 1, z' >= 0, z >= 0
insert#1(z, z') -{ 5 + 4·@ys }→ s10 :|: s10 >= 0, s10 <= 1 * z' + 1 * @y + 1 * @ys + 2, s7 >= 0, s7 <= 2, s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 3 + 4·z1 }→ 1 + z'' + s9 :|: s9 >= 0, s9 <= 1 * z' + 1 * z1 + 1, z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 1 }→ insertionsort#1(z) :|: z >= 0
insertionsort#1(z) -{ 2 }→ insert(@x, insertionsort#1(@xs)) :|: @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {insertionsort#1}, {flatten}, {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
#cklt: runtime: O(1) [0], size: O(1) [2]
#less: runtime: O(1) [1], size: O(1) [2]
insert#2: runtime: O(n1) [3 + 4·z1], size: O(n1) [2 + z' + z'' + z1]
insert: runtime: O(n1) [2 + 4·z'], size: O(n1) [1 + z + z']
insert#1: runtime: O(n1) [1 + 4·z], size: O(n1) [1 + z + z']
flatten#1: runtime: O(n2) [1 + 8·z + 2·z2], size: O(n1) [1 + z]

(53) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: insertionsort#1
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z

(54) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ s5 :|: s5 >= 0, s5 <= 2, s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ s6 :|: s6 >= 0, s6 <= 2, s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
append(z, z') -{ 2 + 2·z }→ s3 :|: s3 >= 0, s3 <= 1 * z + 1 * z', z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 3 + 2·@xs }→ 1 + @x + s4 :|: s4 >= 0, s4 <= 1 * @xs + 1 * z', @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 2 + 8·z + 2·z2 }→ s11 :|: s11 >= 0, s11 <= 1 * z + 1, z >= 0
flatten#1(z) -{ 9 + 2·@l + 8·@t1 + 2·@t12 + 8·@t2 + 2·@t22 + 2·s12 }→ s15 :|: s12 >= 0, s12 <= 1 * @t1 + 1, s13 >= 0, s13 <= 1 * @t2 + 1, s14 >= 0, s14 <= 1 * s12 + 1 * s13, s15 >= 0, s15 <= 1 * @l + 1 * s14, @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 3 + 8·z + 2·z2 }→ insertionsort(s16) :|: s16 >= 0, s16 <= 1 * z + 1, z >= 0
insert(z, z') -{ 2 + 4·z' }→ s8 :|: s8 >= 0, s8 <= 1 * z' + 1 * z + 1, z' >= 0, z >= 0
insert#1(z, z') -{ 5 + 4·@ys }→ s10 :|: s10 >= 0, s10 <= 1 * z' + 1 * @y + 1 * @ys + 2, s7 >= 0, s7 <= 2, s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 3 + 4·z1 }→ 1 + z'' + s9 :|: s9 >= 0, s9 <= 1 * z' + 1 * z1 + 1, z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 1 }→ insertionsort#1(z) :|: z >= 0
insertionsort#1(z) -{ 2 }→ insert(@x, insertionsort#1(@xs)) :|: @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {insertionsort#1}, {flatten}, {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
#cklt: runtime: O(1) [0], size: O(1) [2]
#less: runtime: O(1) [1], size: O(1) [2]
insert#2: runtime: O(n1) [3 + 4·z1], size: O(n1) [2 + z' + z'' + z1]
insert: runtime: O(n1) [2 + 4·z'], size: O(n1) [1 + z + z']
insert#1: runtime: O(n1) [1 + 4·z], size: O(n1) [1 + z + z']
flatten#1: runtime: O(n2) [1 + 8·z + 2·z2], size: O(n1) [1 + z]
insertionsort#1: runtime: ?, size: O(n1) [z]

(55) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: insertionsort#1
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 1 + 4·z2

(56) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ s5 :|: s5 >= 0, s5 <= 2, s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ s6 :|: s6 >= 0, s6 <= 2, s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
append(z, z') -{ 2 + 2·z }→ s3 :|: s3 >= 0, s3 <= 1 * z + 1 * z', z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 3 + 2·@xs }→ 1 + @x + s4 :|: s4 >= 0, s4 <= 1 * @xs + 1 * z', @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 2 + 8·z + 2·z2 }→ s11 :|: s11 >= 0, s11 <= 1 * z + 1, z >= 0
flatten#1(z) -{ 9 + 2·@l + 8·@t1 + 2·@t12 + 8·@t2 + 2·@t22 + 2·s12 }→ s15 :|: s12 >= 0, s12 <= 1 * @t1 + 1, s13 >= 0, s13 <= 1 * @t2 + 1, s14 >= 0, s14 <= 1 * s12 + 1 * s13, s15 >= 0, s15 <= 1 * @l + 1 * s14, @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 3 + 8·z + 2·z2 }→ insertionsort(s16) :|: s16 >= 0, s16 <= 1 * z + 1, z >= 0
insert(z, z') -{ 2 + 4·z' }→ s8 :|: s8 >= 0, s8 <= 1 * z' + 1 * z + 1, z' >= 0, z >= 0
insert#1(z, z') -{ 5 + 4·@ys }→ s10 :|: s10 >= 0, s10 <= 1 * z' + 1 * @y + 1 * @ys + 2, s7 >= 0, s7 <= 2, s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 3 + 4·z1 }→ 1 + z'' + s9 :|: s9 >= 0, s9 <= 1 * z' + 1 * z1 + 1, z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 1 }→ insertionsort#1(z) :|: z >= 0
insertionsort#1(z) -{ 2 }→ insert(@x, insertionsort#1(@xs)) :|: @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {flatten}, {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
#cklt: runtime: O(1) [0], size: O(1) [2]
#less: runtime: O(1) [1], size: O(1) [2]
insert#2: runtime: O(n1) [3 + 4·z1], size: O(n1) [2 + z' + z'' + z1]
insert: runtime: O(n1) [2 + 4·z'], size: O(n1) [1 + z + z']
insert#1: runtime: O(n1) [1 + 4·z], size: O(n1) [1 + z + z']
flatten#1: runtime: O(n2) [1 + 8·z + 2·z2], size: O(n1) [1 + z]
insertionsort#1: runtime: O(n2) [1 + 4·z2], size: O(n1) [z]

(57) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(58) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ s5 :|: s5 >= 0, s5 <= 2, s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ s6 :|: s6 >= 0, s6 <= 2, s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
append(z, z') -{ 2 + 2·z }→ s3 :|: s3 >= 0, s3 <= 1 * z + 1 * z', z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 3 + 2·@xs }→ 1 + @x + s4 :|: s4 >= 0, s4 <= 1 * @xs + 1 * z', @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 2 + 8·z + 2·z2 }→ s11 :|: s11 >= 0, s11 <= 1 * z + 1, z >= 0
flatten#1(z) -{ 9 + 2·@l + 8·@t1 + 2·@t12 + 8·@t2 + 2·@t22 + 2·s12 }→ s15 :|: s12 >= 0, s12 <= 1 * @t1 + 1, s13 >= 0, s13 <= 1 * @t2 + 1, s14 >= 0, s14 <= 1 * s12 + 1 * s13, s15 >= 0, s15 <= 1 * @l + 1 * s14, @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 3 + 8·z + 2·z2 }→ insertionsort(s16) :|: s16 >= 0, s16 <= 1 * z + 1, z >= 0
insert(z, z') -{ 2 + 4·z' }→ s8 :|: s8 >= 0, s8 <= 1 * z' + 1 * z + 1, z' >= 0, z >= 0
insert#1(z, z') -{ 5 + 4·@ys }→ s10 :|: s10 >= 0, s10 <= 1 * z' + 1 * @y + 1 * @ys + 2, s7 >= 0, s7 <= 2, s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 3 + 4·z1 }→ 1 + z'' + s9 :|: s9 >= 0, s9 <= 1 * z' + 1 * z1 + 1, z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 2 + 4·z2 }→ s17 :|: s17 >= 0, s17 <= 1 * z, z >= 0
insertionsort#1(z) -{ 5 + 4·@xs2 + 4·s18 }→ s19 :|: s18 >= 0, s18 <= 1 * @xs, s19 >= 0, s19 <= 1 * @x + 1 * s18 + 1, @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {flatten}, {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
#cklt: runtime: O(1) [0], size: O(1) [2]
#less: runtime: O(1) [1], size: O(1) [2]
insert#2: runtime: O(n1) [3 + 4·z1], size: O(n1) [2 + z' + z'' + z1]
insert: runtime: O(n1) [2 + 4·z'], size: O(n1) [1 + z + z']
insert#1: runtime: O(n1) [1 + 4·z], size: O(n1) [1 + z + z']
flatten#1: runtime: O(n2) [1 + 8·z + 2·z2], size: O(n1) [1 + z]
insertionsort#1: runtime: O(n2) [1 + 4·z2], size: O(n1) [z]

(59) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: flatten
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + z

(60) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ s5 :|: s5 >= 0, s5 <= 2, s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ s6 :|: s6 >= 0, s6 <= 2, s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
append(z, z') -{ 2 + 2·z }→ s3 :|: s3 >= 0, s3 <= 1 * z + 1 * z', z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 3 + 2·@xs }→ 1 + @x + s4 :|: s4 >= 0, s4 <= 1 * @xs + 1 * z', @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 2 + 8·z + 2·z2 }→ s11 :|: s11 >= 0, s11 <= 1 * z + 1, z >= 0
flatten#1(z) -{ 9 + 2·@l + 8·@t1 + 2·@t12 + 8·@t2 + 2·@t22 + 2·s12 }→ s15 :|: s12 >= 0, s12 <= 1 * @t1 + 1, s13 >= 0, s13 <= 1 * @t2 + 1, s14 >= 0, s14 <= 1 * s12 + 1 * s13, s15 >= 0, s15 <= 1 * @l + 1 * s14, @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 3 + 8·z + 2·z2 }→ insertionsort(s16) :|: s16 >= 0, s16 <= 1 * z + 1, z >= 0
insert(z, z') -{ 2 + 4·z' }→ s8 :|: s8 >= 0, s8 <= 1 * z' + 1 * z + 1, z' >= 0, z >= 0
insert#1(z, z') -{ 5 + 4·@ys }→ s10 :|: s10 >= 0, s10 <= 1 * z' + 1 * @y + 1 * @ys + 2, s7 >= 0, s7 <= 2, s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 3 + 4·z1 }→ 1 + z'' + s9 :|: s9 >= 0, s9 <= 1 * z' + 1 * z1 + 1, z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 2 + 4·z2 }→ s17 :|: s17 >= 0, s17 <= 1 * z, z >= 0
insertionsort#1(z) -{ 5 + 4·@xs2 + 4·s18 }→ s19 :|: s18 >= 0, s18 <= 1 * @xs, s19 >= 0, s19 <= 1 * @x + 1 * s18 + 1, @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {flatten}, {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
#cklt: runtime: O(1) [0], size: O(1) [2]
#less: runtime: O(1) [1], size: O(1) [2]
insert#2: runtime: O(n1) [3 + 4·z1], size: O(n1) [2 + z' + z'' + z1]
insert: runtime: O(n1) [2 + 4·z'], size: O(n1) [1 + z + z']
insert#1: runtime: O(n1) [1 + 4·z], size: O(n1) [1 + z + z']
flatten#1: runtime: O(n2) [1 + 8·z + 2·z2], size: O(n1) [1 + z]
insertionsort#1: runtime: O(n2) [1 + 4·z2], size: O(n1) [z]
flatten: runtime: ?, size: O(n1) [1 + z]

(61) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using KoAT for: flatten
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 2 + 8·z + 2·z2

(62) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ s5 :|: s5 >= 0, s5 <= 2, s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ s6 :|: s6 >= 0, s6 <= 2, s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
append(z, z') -{ 2 + 2·z }→ s3 :|: s3 >= 0, s3 <= 1 * z + 1 * z', z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 3 + 2·@xs }→ 1 + @x + s4 :|: s4 >= 0, s4 <= 1 * @xs + 1 * z', @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 2 + 8·z + 2·z2 }→ s11 :|: s11 >= 0, s11 <= 1 * z + 1, z >= 0
flatten#1(z) -{ 9 + 2·@l + 8·@t1 + 2·@t12 + 8·@t2 + 2·@t22 + 2·s12 }→ s15 :|: s12 >= 0, s12 <= 1 * @t1 + 1, s13 >= 0, s13 <= 1 * @t2 + 1, s14 >= 0, s14 <= 1 * s12 + 1 * s13, s15 >= 0, s15 <= 1 * @l + 1 * s14, @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 3 + 8·z + 2·z2 }→ insertionsort(s16) :|: s16 >= 0, s16 <= 1 * z + 1, z >= 0
insert(z, z') -{ 2 + 4·z' }→ s8 :|: s8 >= 0, s8 <= 1 * z' + 1 * z + 1, z' >= 0, z >= 0
insert#1(z, z') -{ 5 + 4·@ys }→ s10 :|: s10 >= 0, s10 <= 1 * z' + 1 * @y + 1 * @ys + 2, s7 >= 0, s7 <= 2, s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 3 + 4·z1 }→ 1 + z'' + s9 :|: s9 >= 0, s9 <= 1 * z' + 1 * z1 + 1, z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 2 + 4·z2 }→ s17 :|: s17 >= 0, s17 <= 1 * z, z >= 0
insertionsort#1(z) -{ 5 + 4·@xs2 + 4·s18 }→ s19 :|: s18 >= 0, s18 <= 1 * @xs, s19 >= 0, s19 <= 1 * @x + 1 * s18 + 1, @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
#cklt: runtime: O(1) [0], size: O(1) [2]
#less: runtime: O(1) [1], size: O(1) [2]
insert#2: runtime: O(n1) [3 + 4·z1], size: O(n1) [2 + z' + z'' + z1]
insert: runtime: O(n1) [2 + 4·z'], size: O(n1) [1 + z + z']
insert#1: runtime: O(n1) [1 + 4·z], size: O(n1) [1 + z + z']
flatten#1: runtime: O(n2) [1 + 8·z + 2·z2], size: O(n1) [1 + z]
insertionsort#1: runtime: O(n2) [1 + 4·z2], size: O(n1) [z]
flatten: runtime: O(n2) [2 + 8·z + 2·z2], size: O(n1) [1 + z]

(63) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(64) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ s5 :|: s5 >= 0, s5 <= 2, s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ s6 :|: s6 >= 0, s6 <= 2, s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
append(z, z') -{ 2 + 2·z }→ s3 :|: s3 >= 0, s3 <= 1 * z + 1 * z', z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 3 + 2·@xs }→ 1 + @x + s4 :|: s4 >= 0, s4 <= 1 * @xs + 1 * z', @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 2 + 8·z + 2·z2 }→ s11 :|: s11 >= 0, s11 <= 1 * z + 1, z >= 0
flatten#1(z) -{ 9 + 2·@l + 8·@t1 + 2·@t12 + 8·@t2 + 2·@t22 + 2·s12 }→ s15 :|: s12 >= 0, s12 <= 1 * @t1 + 1, s13 >= 0, s13 <= 1 * @t2 + 1, s14 >= 0, s14 <= 1 * s12 + 1 * s13, s15 >= 0, s15 <= 1 * @l + 1 * s14, @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 3 + 8·z + 2·z2 }→ insertionsort(s16) :|: s16 >= 0, s16 <= 1 * z + 1, z >= 0
insert(z, z') -{ 2 + 4·z' }→ s8 :|: s8 >= 0, s8 <= 1 * z' + 1 * z + 1, z' >= 0, z >= 0
insert#1(z, z') -{ 5 + 4·@ys }→ s10 :|: s10 >= 0, s10 <= 1 * z' + 1 * @y + 1 * @ys + 2, s7 >= 0, s7 <= 2, s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 3 + 4·z1 }→ 1 + z'' + s9 :|: s9 >= 0, s9 <= 1 * z' + 1 * z1 + 1, z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 2 + 4·z2 }→ s17 :|: s17 >= 0, s17 <= 1 * z, z >= 0
insertionsort#1(z) -{ 5 + 4·@xs2 + 4·s18 }→ s19 :|: s18 >= 0, s18 <= 1 * @xs, s19 >= 0, s19 <= 1 * @x + 1 * s18 + 1, @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
#cklt: runtime: O(1) [0], size: O(1) [2]
#less: runtime: O(1) [1], size: O(1) [2]
insert#2: runtime: O(n1) [3 + 4·z1], size: O(n1) [2 + z' + z'' + z1]
insert: runtime: O(n1) [2 + 4·z'], size: O(n1) [1 + z + z']
insert#1: runtime: O(n1) [1 + 4·z], size: O(n1) [1 + z + z']
flatten#1: runtime: O(n2) [1 + 8·z + 2·z2], size: O(n1) [1 + z]
insertionsort#1: runtime: O(n2) [1 + 4·z2], size: O(n1) [z]
flatten: runtime: O(n2) [2 + 8·z + 2·z2], size: O(n1) [1 + z]

(65) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: insertionsort
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z

(66) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ s5 :|: s5 >= 0, s5 <= 2, s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ s6 :|: s6 >= 0, s6 <= 2, s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
append(z, z') -{ 2 + 2·z }→ s3 :|: s3 >= 0, s3 <= 1 * z + 1 * z', z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 3 + 2·@xs }→ 1 + @x + s4 :|: s4 >= 0, s4 <= 1 * @xs + 1 * z', @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 2 + 8·z + 2·z2 }→ s11 :|: s11 >= 0, s11 <= 1 * z + 1, z >= 0
flatten#1(z) -{ 9 + 2·@l + 8·@t1 + 2·@t12 + 8·@t2 + 2·@t22 + 2·s12 }→ s15 :|: s12 >= 0, s12 <= 1 * @t1 + 1, s13 >= 0, s13 <= 1 * @t2 + 1, s14 >= 0, s14 <= 1 * s12 + 1 * s13, s15 >= 0, s15 <= 1 * @l + 1 * s14, @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 3 + 8·z + 2·z2 }→ insertionsort(s16) :|: s16 >= 0, s16 <= 1 * z + 1, z >= 0
insert(z, z') -{ 2 + 4·z' }→ s8 :|: s8 >= 0, s8 <= 1 * z' + 1 * z + 1, z' >= 0, z >= 0
insert#1(z, z') -{ 5 + 4·@ys }→ s10 :|: s10 >= 0, s10 <= 1 * z' + 1 * @y + 1 * @ys + 2, s7 >= 0, s7 <= 2, s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 3 + 4·z1 }→ 1 + z'' + s9 :|: s9 >= 0, s9 <= 1 * z' + 1 * z1 + 1, z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 2 + 4·z2 }→ s17 :|: s17 >= 0, s17 <= 1 * z, z >= 0
insertionsort#1(z) -{ 5 + 4·@xs2 + 4·s18 }→ s19 :|: s18 >= 0, s18 <= 1 * @xs, s19 >= 0, s19 <= 1 * @x + 1 * s18 + 1, @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {insertionsort}, {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
#cklt: runtime: O(1) [0], size: O(1) [2]
#less: runtime: O(1) [1], size: O(1) [2]
insert#2: runtime: O(n1) [3 + 4·z1], size: O(n1) [2 + z' + z'' + z1]
insert: runtime: O(n1) [2 + 4·z'], size: O(n1) [1 + z + z']
insert#1: runtime: O(n1) [1 + 4·z], size: O(n1) [1 + z + z']
flatten#1: runtime: O(n2) [1 + 8·z + 2·z2], size: O(n1) [1 + z]
insertionsort#1: runtime: O(n2) [1 + 4·z2], size: O(n1) [z]
flatten: runtime: O(n2) [2 + 8·z + 2·z2], size: O(n1) [1 + z]
insertionsort: runtime: ?, size: O(n1) [z]

(67) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using KoAT for: insertionsort
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 2 + 4·z2

(68) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ s5 :|: s5 >= 0, s5 <= 2, s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ s6 :|: s6 >= 0, s6 <= 2, s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
append(z, z') -{ 2 + 2·z }→ s3 :|: s3 >= 0, s3 <= 1 * z + 1 * z', z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 3 + 2·@xs }→ 1 + @x + s4 :|: s4 >= 0, s4 <= 1 * @xs + 1 * z', @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 2 + 8·z + 2·z2 }→ s11 :|: s11 >= 0, s11 <= 1 * z + 1, z >= 0
flatten#1(z) -{ 9 + 2·@l + 8·@t1 + 2·@t12 + 8·@t2 + 2·@t22 + 2·s12 }→ s15 :|: s12 >= 0, s12 <= 1 * @t1 + 1, s13 >= 0, s13 <= 1 * @t2 + 1, s14 >= 0, s14 <= 1 * s12 + 1 * s13, s15 >= 0, s15 <= 1 * @l + 1 * s14, @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 3 + 8·z + 2·z2 }→ insertionsort(s16) :|: s16 >= 0, s16 <= 1 * z + 1, z >= 0
insert(z, z') -{ 2 + 4·z' }→ s8 :|: s8 >= 0, s8 <= 1 * z' + 1 * z + 1, z' >= 0, z >= 0
insert#1(z, z') -{ 5 + 4·@ys }→ s10 :|: s10 >= 0, s10 <= 1 * z' + 1 * @y + 1 * @ys + 2, s7 >= 0, s7 <= 2, s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 3 + 4·z1 }→ 1 + z'' + s9 :|: s9 >= 0, s9 <= 1 * z' + 1 * z1 + 1, z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 2 + 4·z2 }→ s17 :|: s17 >= 0, s17 <= 1 * z, z >= 0
insertionsort#1(z) -{ 5 + 4·@xs2 + 4·s18 }→ s19 :|: s18 >= 0, s18 <= 1 * @xs, s19 >= 0, s19 <= 1 * @x + 1 * s18 + 1, @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
#cklt: runtime: O(1) [0], size: O(1) [2]
#less: runtime: O(1) [1], size: O(1) [2]
insert#2: runtime: O(n1) [3 + 4·z1], size: O(n1) [2 + z' + z'' + z1]
insert: runtime: O(n1) [2 + 4·z'], size: O(n1) [1 + z + z']
insert#1: runtime: O(n1) [1 + 4·z], size: O(n1) [1 + z + z']
flatten#1: runtime: O(n2) [1 + 8·z + 2·z2], size: O(n1) [1 + z]
insertionsort#1: runtime: O(n2) [1 + 4·z2], size: O(n1) [z]
flatten: runtime: O(n2) [2 + 8·z + 2·z2], size: O(n1) [1 + z]
insertionsort: runtime: O(n2) [2 + 4·z2], size: O(n1) [z]

(69) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(70) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ s5 :|: s5 >= 0, s5 <= 2, s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ s6 :|: s6 >= 0, s6 <= 2, s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
append(z, z') -{ 2 + 2·z }→ s3 :|: s3 >= 0, s3 <= 1 * z + 1 * z', z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 3 + 2·@xs }→ 1 + @x + s4 :|: s4 >= 0, s4 <= 1 * @xs + 1 * z', @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 2 + 8·z + 2·z2 }→ s11 :|: s11 >= 0, s11 <= 1 * z + 1, z >= 0
flatten#1(z) -{ 9 + 2·@l + 8·@t1 + 2·@t12 + 8·@t2 + 2·@t22 + 2·s12 }→ s15 :|: s12 >= 0, s12 <= 1 * @t1 + 1, s13 >= 0, s13 <= 1 * @t2 + 1, s14 >= 0, s14 <= 1 * s12 + 1 * s13, s15 >= 0, s15 <= 1 * @l + 1 * s14, @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 5 + 4·s162 + 8·z + 2·z2 }→ s20 :|: s20 >= 0, s20 <= 1 * s16, s16 >= 0, s16 <= 1 * z + 1, z >= 0
insert(z, z') -{ 2 + 4·z' }→ s8 :|: s8 >= 0, s8 <= 1 * z' + 1 * z + 1, z' >= 0, z >= 0
insert#1(z, z') -{ 5 + 4·@ys }→ s10 :|: s10 >= 0, s10 <= 1 * z' + 1 * @y + 1 * @ys + 2, s7 >= 0, s7 <= 2, s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 3 + 4·z1 }→ 1 + z'' + s9 :|: s9 >= 0, s9 <= 1 * z' + 1 * z1 + 1, z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 2 + 4·z2 }→ s17 :|: s17 >= 0, s17 <= 1 * z, z >= 0
insertionsort#1(z) -{ 5 + 4·@xs2 + 4·s18 }→ s19 :|: s18 >= 0, s18 <= 1 * @xs, s19 >= 0, s19 <= 1 * @x + 1 * s18 + 1, @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
#cklt: runtime: O(1) [0], size: O(1) [2]
#less: runtime: O(1) [1], size: O(1) [2]
insert#2: runtime: O(n1) [3 + 4·z1], size: O(n1) [2 + z' + z'' + z1]
insert: runtime: O(n1) [2 + 4·z'], size: O(n1) [1 + z + z']
insert#1: runtime: O(n1) [1 + 4·z], size: O(n1) [1 + z + z']
flatten#1: runtime: O(n2) [1 + 8·z + 2·z2], size: O(n1) [1 + z]
insertionsort#1: runtime: O(n2) [1 + 4·z2], size: O(n1) [z]
flatten: runtime: O(n2) [2 + 8·z + 2·z2], size: O(n1) [1 + z]
insertionsort: runtime: O(n2) [2 + 4·z2], size: O(n1) [z]

(71) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: flattensort
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + z

(72) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ s5 :|: s5 >= 0, s5 <= 2, s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ s6 :|: s6 >= 0, s6 <= 2, s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
append(z, z') -{ 2 + 2·z }→ s3 :|: s3 >= 0, s3 <= 1 * z + 1 * z', z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 3 + 2·@xs }→ 1 + @x + s4 :|: s4 >= 0, s4 <= 1 * @xs + 1 * z', @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 2 + 8·z + 2·z2 }→ s11 :|: s11 >= 0, s11 <= 1 * z + 1, z >= 0
flatten#1(z) -{ 9 + 2·@l + 8·@t1 + 2·@t12 + 8·@t2 + 2·@t22 + 2·s12 }→ s15 :|: s12 >= 0, s12 <= 1 * @t1 + 1, s13 >= 0, s13 <= 1 * @t2 + 1, s14 >= 0, s14 <= 1 * s12 + 1 * s13, s15 >= 0, s15 <= 1 * @l + 1 * s14, @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 5 + 4·s162 + 8·z + 2·z2 }→ s20 :|: s20 >= 0, s20 <= 1 * s16, s16 >= 0, s16 <= 1 * z + 1, z >= 0
insert(z, z') -{ 2 + 4·z' }→ s8 :|: s8 >= 0, s8 <= 1 * z' + 1 * z + 1, z' >= 0, z >= 0
insert#1(z, z') -{ 5 + 4·@ys }→ s10 :|: s10 >= 0, s10 <= 1 * z' + 1 * @y + 1 * @ys + 2, s7 >= 0, s7 <= 2, s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 3 + 4·z1 }→ 1 + z'' + s9 :|: s9 >= 0, s9 <= 1 * z' + 1 * z1 + 1, z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 2 + 4·z2 }→ s17 :|: s17 >= 0, s17 <= 1 * z, z >= 0
insertionsort#1(z) -{ 5 + 4·@xs2 + 4·s18 }→ s19 :|: s18 >= 0, s18 <= 1 * @xs, s19 >= 0, s19 <= 1 * @x + 1 * s18 + 1, @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed: {flattensort}
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
#cklt: runtime: O(1) [0], size: O(1) [2]
#less: runtime: O(1) [1], size: O(1) [2]
insert#2: runtime: O(n1) [3 + 4·z1], size: O(n1) [2 + z' + z'' + z1]
insert: runtime: O(n1) [2 + 4·z'], size: O(n1) [1 + z + z']
insert#1: runtime: O(n1) [1 + 4·z], size: O(n1) [1 + z + z']
flatten#1: runtime: O(n2) [1 + 8·z + 2·z2], size: O(n1) [1 + z]
insertionsort#1: runtime: O(n2) [1 + 4·z2], size: O(n1) [z]
flatten: runtime: O(n2) [2 + 8·z + 2·z2], size: O(n1) [1 + z]
insertionsort: runtime: O(n2) [2 + 4·z2], size: O(n1) [z]
flattensort: runtime: ?, size: O(n1) [1 + z]

(73) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using KoAT for: flattensort
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 9 + 16·z + 6·z2

(74) Obligation:

Complexity RNTS consisting of the following rules:

#cklt(z) -{ 0 }→ 2 :|: z = 3
#cklt(z) -{ 0 }→ 1 :|: z = 1
#cklt(z) -{ 0 }→ 1 :|: z = 2
#cklt(z) -{ 0 }→ 0 :|: z >= 0
#compare(z, z') -{ 0 }→ s :|: s >= 0, s <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ s' :|: s' >= 0, s' <= 3, z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 3 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z = 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' = 0
#compare(z, z') -{ 0 }→ 2 :|: z - 1 >= 0, z' - 1 >= 0
#compare(z, z') -{ 0 }→ 1 :|: z = 0, z' = 0
#compare(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
#less(z, z') -{ 1 }→ s5 :|: s5 >= 0, s5 <= 2, s'' >= 0, s'' <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ s6 :|: s6 >= 0, s6 <= 2, s1 >= 0, s1 <= 3, z' - 1 >= 0, z - 1 >= 0
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z - 1 >= 0, z' = 0, 3 = 3
#less(z, z') -{ 1 }→ 2 :|: z' - 1 >= 0, z - 1 >= 0, 3 = 3
#less(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0, 1 = 1
#less(z, z') -{ 1 }→ 1 :|: z' - 1 >= 0, z = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' = 0, 2 = 2
#less(z, z') -{ 1 }→ 1 :|: z - 1 >= 0, z' - 1 >= 0, 2 = 2
#less(z, z') -{ 1 }→ 0 :|: z = 0, z' = 0, v0 >= 0, 1 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z' - 1 >= 0, z - 1 >= 0, v0 >= 0, 3 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 2 = v0
#less(z, z') -{ 1 }→ 0 :|: z >= 0, z' >= 0, v0 >= 0, 0 = v0
append(z, z') -{ 2 + 2·z }→ s3 :|: s3 >= 0, s3 <= 1 * z + 1 * z', z >= 0, z' >= 0
append#1(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
append#1(z, z') -{ 3 + 2·@xs }→ 1 + @x + s4 :|: s4 >= 0, s4 <= 1 * @xs + 1 * z', @x >= 0, z = 1 + @x + @xs, z' >= 0, @xs >= 0
flatten(z) -{ 2 + 8·z + 2·z2 }→ s11 :|: s11 >= 0, s11 <= 1 * z + 1, z >= 0
flatten#1(z) -{ 9 + 2·@l + 8·@t1 + 2·@t12 + 8·@t2 + 2·@t22 + 2·s12 }→ s15 :|: s12 >= 0, s12 <= 1 * @t1 + 1, s13 >= 0, s13 <= 1 * @t2 + 1, s14 >= 0, s14 <= 1 * s12 + 1 * s13, s15 >= 0, s15 <= 1 * @l + 1 * s14, @l >= 0, @t1 >= 0, @t2 >= 0, z = 1 + @l + @t1 + @t2
flatten#1(z) -{ 1 }→ 0 :|: z = 0
flattensort(z) -{ 5 + 4·s162 + 8·z + 2·z2 }→ s20 :|: s20 >= 0, s20 <= 1 * s16, s16 >= 0, s16 <= 1 * z + 1, z >= 0
insert(z, z') -{ 2 + 4·z' }→ s8 :|: s8 >= 0, s8 <= 1 * z' + 1 * z + 1, z' >= 0, z >= 0
insert#1(z, z') -{ 5 + 4·@ys }→ s10 :|: s10 >= 0, s10 <= 1 * z' + 1 * @y + 1 * @ys + 2, s7 >= 0, s7 <= 2, s2 >= 0, s2 <= 3, z = 1 + @y + @ys, z' >= 0, @y >= 0, @ys >= 0
insert#1(z, z') -{ 1 }→ 1 + z' + 0 :|: z' >= 0, z = 0
insert#2(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 1 }→ 1 + z' + (1 + z'' + z1) :|: z' >= 0, z = 1, z'' >= 0, z1 >= 0
insert#2(z, z', z'', z1) -{ 3 + 4·z1 }→ 1 + z'' + s9 :|: s9 >= 0, s9 <= 1 * z' + 1 * z1 + 1, z = 2, z' >= 0, z'' >= 0, z1 >= 0
insertionsort(z) -{ 2 + 4·z2 }→ s17 :|: s17 >= 0, s17 <= 1 * z, z >= 0
insertionsort#1(z) -{ 5 + 4·@xs2 + 4·s18 }→ s19 :|: s18 >= 0, s18 <= 1 * @xs, s19 >= 0, s19 <= 1 * @x + 1 * s18 + 1, @x >= 0, z = 1 + @x + @xs, @xs >= 0
insertionsort#1(z) -{ 1 }→ 0 :|: z = 0

Function symbols to be analyzed:
Previous analysis results are:
#compare: runtime: O(1) [0], size: O(1) [3]
append#1: runtime: O(n1) [1 + 2·z], size: O(n1) [z + z']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
#cklt: runtime: O(1) [0], size: O(1) [2]
#less: runtime: O(1) [1], size: O(1) [2]
insert#2: runtime: O(n1) [3 + 4·z1], size: O(n1) [2 + z' + z'' + z1]
insert: runtime: O(n1) [2 + 4·z'], size: O(n1) [1 + z + z']
insert#1: runtime: O(n1) [1 + 4·z], size: O(n1) [1 + z + z']
flatten#1: runtime: O(n2) [1 + 8·z + 2·z2], size: O(n1) [1 + z]
insertionsort#1: runtime: O(n2) [1 + 4·z2], size: O(n1) [z]
flatten: runtime: O(n2) [2 + 8·z + 2·z2], size: O(n1) [1 + z]
insertionsort: runtime: O(n2) [2 + 4·z2], size: O(n1) [z]
flattensort: runtime: O(n2) [9 + 16·z + 6·z2], size: O(n1) [1 + z]

(75) FinalProof (EQUIVALENT transformation)

Computed overall runtime complexity

(76) BOUNDS(1, n^2)